#include "stdafx.h"
#include "CWordExer.h"
#pragma once
#define WIN32_LEAN_AND_MEAN	
#define _CRT_SECURE_NO_DEPRECATE
#include <windows.h>
#include <objbase.h>
#include "UIlib.h"
using namespace DuiLib;
class CParticular : public CWindowWnd, public INotifyUI
{
public:
	CParticular()
	{
		m_bInMsg = false;
	};
	LPCTSTR GetWindowClassName() const 
	{ 
		return _T("UIMainFrame"); 
	};
	UINT GetClassStyle() const 
	{ 
		return UI_CLASSSTYLE_FRAME | CS_DBLCLKS; 
	};
	void OnFinalMessage(HWND /*hWnd*/) 
	{ 
		/*delete this;*/
	};
	void Init() { }
	void OnPrepare(TNotifyUI& msg) ;
	void Notify(TNotifyUI& msg);
	LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
	////////////////////////////////////
	void InitWordStatus0();
	void SetVoiceRateBySetting(LPCTSTR lpstrSpeaker, LPCTSTR lpstrSpeed/* = NULL*/);
	void SetVoiceRateByValue(LPCTSTR lpstrSpeaker, LPCTSTR lpstrSpeed/* = NULL*/);
	void WordUpdateWordCount();
	void WordChangeAddNewWordBtn();
	void InitWordBookCombo(LPCTSTR lpstrBook = NULL);
	void InitWordUnitCombo(LPCTSTR lpstrUnit  = NULL);
	void InitWordGroupList(LPCTSTR lpstrGroup = NULL);
	void InitControls(TNotifyUI& msg);
	void InitWordGradeCombo(LPCTSTR lpstrGrade  = NULL);
public:
	CPaintManagerUI m_PaintManager;
	CComPtr<ISpVoice> m_cpVoice;
	bool m_bFreshGrpList;
	CString m_strGrade;
	CString m_strBook;
	CString m_strUnit;
	bool m_bInMsg;
};